{% extends 'social_base.html' %}
{% load static %}
{% block title %}
修改{{ user_profile.user.username }}的个人信息
{% endblock %}
{% block head %}
<style>
    body {
        font-family: 'Arial', sans-serif;
        margin: 0;
        padding: 0;
        background-color: #f5f5f5;
        background-image: url('{% static 'images/img.png' %}');
        background-size: cover;
    }
</style>
{% endblock %}
{% block body %}
<div class="edit-container">
    <h2 class="title ">用户信息修改</h2>
    <br><br>

    <form method="post" enctype="multipart/form-data">
        {% csrf_token %}

        <div class="form-group">
            <label for="nickname"><strong>昵称 </strong></label>

            <input type="text" name="nickname" id="nickname" value="{{ user_profile.nickname }}">
        </div>
        <br>
        <div class="form-group">
            <label for="bio"><strong>个性签名</strong></label>
            <textarea name="bio" id="bio">{{ user_profile.bio }}</textarea>
        </div>
        <br>
        <div class="form-group">
            <label for="avatar"><strong>更换头像</strong></label>
            <input type="file" name="avatar" id="avatar">
        </div>
        <br>
        <div class="form-group">
            <label for="background_image"><strong>更换背景</strong></label>
            <input type="file" name="background_image" id="background_image">
        </div>
        <br>
        <br>
        <div class="container centered-div">
            <input type="submit" value="保存修改" class="btn btn-primary btn-edit">
        </div>
    </form>

</div>

<script>

    function confirmDelete() {
        // 使用 confirm 函数弹出确认对话框
        const result = confirm("是否删除？");


        if (result) {
            document.getElementById("deleteForm").submit();
        } else {
            // 用户点击了取消（否），在这里不执行任何提交表单的操作
        }
    }
</script>
{% endblock %}